//
//  YZLCarImageListCollectionViewCell.m
//  Car
//
//  Created by dllo on 15/11/2.
//  Copyright © 2015年 岳明. All rights reserved.
//

#import "YZLCarImageListCollectionViewCell.h"
#import <UIImageView+WebCache.h>

@interface YZLCarImageListCollectionViewCell ()

@property (nonatomic, strong) UIImageView *carIamge;

@end

@implementation YZLCarImageListCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame {
    
    self = [super initWithFrame:frame];
    if (self) {
        
        self.carIamge = [[UIImageView alloc] init];
        self.carIamge.backgroundColor = [UIColor colorWithWhite:0.900 alpha:1.000];
        [self.contentView addSubview:self.carIamge];
    }
    
    return self;
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes {
    
    self.carIamge.frame = self.contentView.frame;
    
}

- (void)setModel:(YZLCarImageListModel *)model {
    
    if (_model != model) {
        _model = model;
    }
    
    [self.carIamge sd_setImageWithURL:[NSURL URLWithString:self.model.imageSrc] placeholderImage:[UIImage imageNamed:@"D0"]];
    
}

@end
